#!/usr/bin/python

"""Acesta este un fisier in care incerc sa adun multe module de Python definite de mine
"""

"""TO DO :
   Fa modulele -momentan sunt doar niste functii-
"""

__author__ = "Danny MIRC danny.mirc@gm.com"
__version__ = "$Rev :1.2.6$"

import sys


def Search(word,letter):
	"""Cauta litera \'letter\' in cuvantul \'word\'
		 Afiseaza de cate ori a fost gasita aceasta litera in sirul de caractere transmis ca argv[2]
		 Litera de cautat se transmite ca argv[3]
	"""
	c = 0 # contor
	for var in word:
		print var 
		if var == letter:
			c = c + 1
	print "Litera \'",letter,"\' gasita de ",c," ori"		

def Sufix(arg):
	for var in arg:
		print var + 'us'

def AfisCh(arg):
	for ch in arg:
		print ch

def Fctz1():
	print "Esti in functia Fctz1 "

def myMain():
	print "Esti in fctia main a modulului -> ", sys.argv[0][2:]
	print "corp functie AfisCh(argv[1])"
	AfisCh(sys.argv[1])
	vector = ['Daniel','Mihai','Sever','Bogdan','Avram','Iulian','Sebastian','Quint','Ion']
	print "corp functie Sufix(vector)"
	Sufix(vector)
	
	print ""
	print "corp functie Search(argv[2]cuvant,argv[3]litera_de_cautat)"
	Search(sys.argv[2],sys.argv[3])


if __name__ == "__main__":
	myMain()
